/**
 * Yolema.com Inc.
 * Copyright (c) 2011-2012 All Rights Reserved.
 */
package org.grayrabbit.pay.core.biz.manager.trade;

import org.grayrabbit.pay.core.biz.vo.ChinapnrTradeVo;
import org.grayrabbit.pay.core.model.entity.transaction.Trade;
import org.grayrabbit.pay.core.model.results.GenericsResult;
import org.grayrabbit.pay.core.model.results.PayResult;

/**
 * 汇付交易接口
 * 
 * @author wy
 * @version $Id: ChinaPnrTrade.java, v 0.1 2012-11-6 下午3:09:52 wy Exp $
 */
public interface ChinaPnrTradeManager {

    /**
     * 保存交易结果
     * 
     * @param chinapnrTrade
     * @return
     */
    public GenericsResult<Trade> saveTrade(ChinapnrTradeVo chinapnrTrade);

    /**
     * 更新一个对象
     *  非主键更新,根据交易id
     * 
     * @param trade
     * @return
     */
    public PayResult updateChinapnr(Trade trade);

    /**
     * 查询交易
     * 
     * @param trade
     * @return
     */
    public GenericsResult<Trade> queryPay(Trade trade);

    /**
     * 退款
     * 
     * @param chinapnrTrade
     * @return
     */
    public GenericsResult<Trade> saveRefundTrade(ChinapnrTradeVo chinapnrTrade);
    
    /**
     * 更新退款交易
     * 
     * @param trade
     * @param success
     * @return
     */
    public PayResult updateRefundTrade(Trade trade,boolean success);

}
